import request from '@/utils/request'
import qs from 'qs'

export function getOrganizationList(data) {
    return request({
      url: '/admin/organizationList', // 假地址 自行替换
      method: 'get',
      params:data
    })
  }

export function getOrganization(data){
    return request({
        url:'/admin/organization',
        method:'get',
        params:data
    })
}
  
export function searchOrganization(data){
    return request({
        url:'/admin/searchOrganization',
        method:'get',
        params:data
    })
}

export function addOrganization(data){
    return request({
        url:'/admin/organization',
        method: 'put',
        transformRequest: [
            function (data) {
                //在请求之前对data传参进行格式转换
                data = qs.stringify(data);
                return data;
            }
          ],
        data,
        headers:{
            'Content-Type':'application/x-www-form-urlencoded'
        }
    })
}


export function editOrganization(data){
    return request({
        url:'/admin/organization',
        method: 'post',
        transformRequest: [
            function (data) {
                //在请求之前对data传参进行格式转换
                data = qs.stringify(data);
                return data;
            }
          ],
        data,
        headers:{
            'Content-Type':'application/x-www-form-urlencoded'
        }
    })
}

export function deleteOragnization(data){
    return request({
        url:'/admin/organization',
        method: 'delete',
        params:data
    })
}
